import { BaseResult } from "../../dto/baseDto"



export default class ResultUtil {

    static success<T>(data: T, msg = "操作成功"): BaseResult<T> {
        return {
            success: true,
            code: 0,
            data,
            msg
        }
    }

    static successMsg(msg = "操作成功") {
        return {
            success: true,
            code: 0,
            msg,
            data: null,
        }
    }


    static errorMsg(msg = "操作失败") {
        return {
            success: false,
            code: 500,
            msg,
            data: null,
        }
    }
};